"use strict";
class Write {
    constructor(props) {
        this.write = () => {
            const { text, style, className, id, element } = Write.writeInfo;
            let writeHead = `<${element}`;
            if (style) {
                let styleStr = '';
                let styles = JSON.parse(JSON.stringify(style));
                for (let key in styles) {
                    let str = styles[key];
                    styleStr = `${styleStr}${key}:${str};`;
                }
                writeHead = `${writeHead} style=${styleStr}`;
            }
            if (className) {
                writeHead = `${writeHead} class=${className}`;
            }
            if (id) {
                writeHead = `${writeHead} id=${id}`;
            }
            document.write(`${writeHead}>${text}</${element}>`);
        };
        Write.writeInfo = props;
        this.write();
    }
}
/**
 * span标签
 */
class WriteSpan {
    constructor(props) {
        let props_ = JSON.parse(JSON.stringify(props));
        props_.element = 'span';
        new Write(props_);
    }
}
/**
 * H标签
 */
class WriteH {
    constructor(props, number = 1) {
        let props_ = JSON.parse(JSON.stringify(props));
        props_.element = `h${number}`;
        new Write(props_);
    }
    ;
}
/**
 * div标签
 */
class WriteDiv {
    constructor(props) {
        let props_ = JSON.parse(JSON.stringify(props));
        props_.element = 'div';
        new Write(props_);
    }
}
/**
 * span标签写入
 * @param span
 */
const writeSpan = (span) => {
    new WriteSpan(span);
};
/**
 * h标签的写入
 * @param h H标签的信息
 * @param number  第几号标签 默认 1，范围1-6
 */
const writeH = (h, number = 1) => {
    new WriteH(h, number);
};
/**
 * div标签写入
 * @param div
 */
const writeDiv = (div) => {
    new WriteDiv(div);
};
